<template>
<div id="app">
  <loading :show="isLoading"></loading>
  <transition :name="'vux-pop-' + (direction === 'forward' ? 'in' : 'out')">
    <router-view></router-view>
  </transition>
</div>

</template>

<script>
import { Loading } from 'vux';
import { mapState } from 'vuex';
export default {
  components: {
    Loading
  },
  computed: {
    ...mapState({
          isLoading: state => state.isLoading,
          direction: state => state.direction
    })
  }
}

</script>

<style lang="less">
@import '~vux/src/styles/reset.less';
html,
body,
#app,
#app>div:not(.vux-loading) {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  background-color: #fbf9fe;
  min-width: 250px;
  overflow-x: auto;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.vux-pop-out-enter-active,
.vux-pop-out-leave-active,
.vux-pop-in-enter-active,
.vux-pop-in-leave-active {
  will-change: transform;
  transition: all 250ms;
  height: 100%;
  top: 0;
  position: absolute;
  backface-visibility: hidden;
  perspective: 1000;
}

.vux-pop-out-enter {
  opacity: 0;
  transform: translate3d(-100%, 0, 0);
}

.vux-pop-out-leave-active {
  opacity: 0;
  transform: translate3d(100%, 0, 0);
}

.vux-pop-in-enter {
  opacity: 0;
  transform: translate3d(100%, 0, 0);
}

.vux-pop-in-leave-active {
  opacity: 0;
  transform: translate3d(-100%, 0, 0);
}

.touchColor {
  color: #3286FF;
}

.header-page .vux-header {
  background-color: #2486F5;
  .vux-header-left .left-arrow:before {
    border: 1px solid #fff;
    border-width: 3px 0 0 3px;
  }
  .vux-header-right a {
    color: white;
  }
}
</style>
